# coding=utf-8
import json

from hostServerCode.dockerApiModel import dockerAPI


def getAllContainers(dict):
    ''''''
    retuData = dockerAPI.getNodeAllContainer()
    retuData = json.dumps(retuData)

    ret = {'status': True, 'error': None, 'data': retuData}
    return ret


def stopContainer(dict):
    ''''''
    retuData = dockerAPI.stopContainer(dict)
    retuData = json.dumps(retuData)

    ret = {'status': True, 'error': None, 'data': retuData}
    return ret


def start_Container(dict):
    ''''''
    retuData = dockerAPI.startContainer(dict)
    retuData = json.dumps(retuData)

    ret = {'status': True, 'error': None, 'data': retuData}
    return ret

def delete_Container(dict):
    ''''''
    retuData = dockerAPI.deleteContainer(dict)
    retuData = json.dumps(retuData)

    ret = {'status': True, 'error': None, 'data': retuData}
    return ret

def create_Container(dict):
    ''''''
    retuData = dockerAPI.createContainer(dict)
    retuData = json.dumps(retuData)

    ret = {'status': True, 'error': None, 'data': retuData}
    return ret
